Create a department manager

This request is used to assign a role to the department manager. More about roles. The roles that can be assigned to the user can be viewed in his Personal Account.

Request syntax

POST https://b2b-api.go.yandex.ru/integration/2.0/managers/create

Request headers

  • Authorization: Bearer <OAuth-token>
    OAuth access token. The steps to get a token are described in Getting started.
  • X-YaTaxi-Selected-Corp-Client-Id — client ID from the account. Required if multiple clients are available using the token.

Request body

Data for the new department manager is passed in the request body in JSON format:

Field

Description

Format

Required

fullname

The manager's full name.

String

Yes

email

The manager's email.

String

Yes

phone

The manager's phone number.

String

Yes

yandex_login

The manager's login.

String

Yes

role

The manager's role. Possible values: department_manager, department_secretary, client_manager.

String

Yes

department_id

ID of the department.

String

No

Response field description

The response with code 200 contains the following fields:

Field Description Format
id ID of the department manager. String

Request example

POST https://b2b-api.go.yandex.ru/integration/2.0/managers/create
...
Authorization: Bearer <OAuth-token>
X-YaTaxi-Selected-Corp-Client-Id: <client-id>

    {
        "yandex_login": "sample_yandex_login",
        "role": "department_manager",
        "department_id": "3648...396b",
        "phone": "+799900000000",
        "email": "email@example.com",
        "fullname": "John Smith"
    }

Response example

An example response with code 200 looks like this:

{
    "id": "07e4...b2f4"
}

Response codes

The response to this request may contain the following standard HTTP codes:

  • 200: Request completed successfully.
  • 400: An unknown parameter or a parameter with an invalid value was passed in the request.
  • 401: The OAuth token is incorrect.
  • 403: The client doesn't have sufficient rights to run this request.
    • SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header X-YaTaxi-Selected-Corp-Client-Id (returned if more than one client is available for the token).
    • SELECTED_CLIENT_ACCESS_DENIED: the header X-YaTaxi-Selected-Corp-Client-Id contains the client's ID, which this login does not have access to.
  • 409: Concurrent requests conflict.